****************************************************
*Replication File for "Learning from Betrayal: How Do Lessons from the Past Shape Future Alliance Treaty Designs?”;
****************************************************

**************************************
*Tables included in the Article;
**************************************
use "C:\II replication\Li_II_2025_zero10.dta" , clear

**************************************
*Table 1 (DV: formal);
**************************************
*ologit 1;
ologit formal victimprop10 vioprop10 symmetry democracy_prop politydistance threat number war stateage cinc if form==1
estimates store ologit1

*figure 2A;
margins,atmeans at( victimprop10 =(0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1)) noatlegend
marginsplot, ytitle("Probability of Treaty Formality") xtitle("Proportion of Victims")  recast(line) plot1opts(lcolor(black) lwidth(medium))

*logit 1;
logit form victimprop10 vioprop10 symmetry democracy_prop politydistance threat number war stateage cinc
estimates store logit1

*2PM 1;
suest logit1 ologit1
estimates store suest1

*ologit 2;
ologit formal victim_seve violation_seve symmetry democracy_prop politydistance threat number war stateage cinc if form==1
estimates store ologit2

*figure 2B;
margins,atmeans at( victim_seve =(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19)) noatlegend
marginsplot, ytitle("Probability of Treaty Formality") xtitle("Victimization Severity")  recast(line) plot1opts(lcolor(black) lwidth(medium))

*logit 2;
logit form victim_seve violation_seve symmetry democracy_prop politydistance threat number war stateage cinc
estimates store logit2

*2PM 2;
suest logit2 ologit2
estimates store suest2


**************************************
*Table 2 (DV: milinst);
**************************************
*ologit 3;
ologit milinst victimprop10 vioprop10 symmetry democracy_prop politydistance threat number war stateage cinc if form==1
estimates store ologit3

margins,atmeans at( victimprop10 =(0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1)) noatlegend
marginsplot, ytitle("Probability of Military Institutionalization") xtitle("Proportion of Victims")  recast(line) plot1opts(lcolor(black) lwidth(medium))

*logit 3;
logit form victimprop10 vioprop10 symmetry democracy_prop politydistance threat number war stateage cinc
estimates store logit3 

*2PM 1;
suest logit3 ologit3
estimates store suest3


*ologit 4;
ologit milinst victim_seve violation_seve symmetry democracy_prop politydistance threat number war stateage cinc if form==1
estimates store ologit4
margins,atmeans at( victim_seve =(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16)) noatlegend
marginsplot, ytitle("Probability of Military Institutionalization") xtitle("Victimization Severity")  recast(line) plot1opts(lcolor(black) lwidth(medium))	 


*logit 4
logit form victim_seve violation_seve symmetry democracy_prop politydistance threat number war stateage cinc
estimates store logit4

*2PM 2;
suest logit4 ologit4
estimates store suest4




**************************************
*Tables included in the Online Appendix;
**************************************
use "C:\II replication\Li_II_2025_zero5.dta", clear
*Table A1: 5 times more zeros (DV: formal);

*ologit 1;
ologit formal victimprop10 vioprop10 symmetry democracy_prop politydistance threat number war stateage cinc if form==1
estimates store ologit1

*logit 1;
logit form victimprop10 vioprop10 symmetry democracy_prop politydistance threat number war stateage cinc
estimates store logit1

*2PM 1; 
suest logit1 ologit1
estimates store suest1

*ologit 2;
ologit formal victim_seve violation_seve symmetry democracy_prop politydistance threat number war stateage cinc if form==1
estimates store ologit2

*logit 2;
logit form victim_seve violation_seve symmetry democracy_prop politydistance threat number war stateage cinc
estimates store logit2

*2PM 2;
suest logit2 ologit2
estimates store suest2

*Table A2: 5 times more zeros (DV: milinst);
*ologit 3;
ologit milinst victimprop10 vioprop10 symmetry democracy_prop politydistance threat number war stateage cinc if form==1
estimates store ologit3

*logit 3;
logit form victimprop10 vioprop10 symmetry democracy_prop politydistance threat number war stateage cinc
estimates store logit3 

*2PM 1;
suest logit3 ologit3
estimates store suest3

*ologit 4;
ologit milinst victim_seve violation_seve symmetry democracy_prop politydistance threat number war stateage cinc if form==1
estimates store ologit4

*logit 4
logit form victim_seve violation_seve symmetry democracy_prop politydistance threat number war stateage cinc
estimates store logit4

*2PM 2;
suest logit4 ologit4
estimates store suest4


use "C:\II replication\Li_II_2025_zero10.dta", clear
*including newphase;
ologit formal victimprop10 vioprop10 symmetry democracy_prop politydistance threat number war stateage cinc

ologit formal victim_seve violation_seve symmetry democracy_prop politydistance threat number war stateage cinc 

ologit milinst victimprop10 vioprop10 symmetry democracy_prop politydistance threat number war stateage cinc

ologit milinst victim_seve violation_seve symmetry democracy_prop politydistance threat number war stateage cinc 

*bilat only;
ologit formal victimprop10 vioprop10 symmetry democracy_prop politydistance threat number war stateage cinc if bilat==1

ologit formal victim_seve violation_seve symmetry democracy_prop politydistance threat number war stateage cinc if bilat==1

ologit milinst victimprop10 vioprop10 symmetry democracy_prop politydistance threat number war stateage cinc if bilat==1

ologit milinst victim_seve violation_seve symmetry democracy_prop politydistance threat number war stateage cinc if bilat==1

*offense & defense only;
ologit formal victimprop10 vioprop10 symmetry democracy_prop politydistance threat number war stateage cinc if form==1 & (defense==1 | offense==1)

ologit formal victim_seve violation_seve symmetry democracy_prop politydistance threat number war stateage cinc if form==1 & (defense==1 | offense==1)

ologit milinst victimprop10 vioprop10 symmetry democracy_prop politydistance threat number war stateage cinc if form==1 & (defense==1 | offense==1)

ologit milinst victim_seve violation_seve symmetry democracy_prop politydistance threat number war stateage cinc if form==1 & (defense==1 | offense==1)

*15yr or 20yr;
ologit formal victimprop15 vioprop15 symmetry democracy_prop politydistance threat number war stateage cinc if form==1

ologit formal victimprop20 vioprop20 symmetry democracy_prop politydistance threat number war stateage cinc if form==1

ologit milinst victimprop15 vioprop15 symmetry democracy_prop politydistance threat number war stateage cinc if form==1

ologit milinst victimprop20 vioprop20 symmetry democracy_prop politydistance threat number war stateage cinc if form==1

*Tabele A8
use "C:\II replication\alliance_victims.dta" , clear

collapse (count) victim (sum) severity1 severity2 severity3, by (ccode)

gsort -victim








